<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../js/jquery.js"></script>
<script type="text/javascript" src="../../js/purchase/product/productList.js"></script>
<script type="text/javascript">
function tipOpen(content) {
	$(".tipright p").text(content);
	$("#tip").fadeIn(200);
}
function tipClose() {
	$("#tip").fadeOut(200);
}
</script>
</head>

<body>
<div class="place"> <span>位置：</span>
  <ul class="placeul">
    <li>采购管理</li>
    <li>商品管理</li>
    <li>基本内容</li>
  </ul>
</div>
<div class="rightinfo">
  <form id="productForm" th:action="@{/productManage/getProductByCondition}" method="post">
    <ul class="tools">
      <li> 品牌名称:
        <select  name="brandName" class="brandName">
<!--          <option>请选择</option>-->
<!--          <option>联想</option>-->
<!--          <option>海尔</option>-->
        </select>
      </li>
      <li> 商品类型:
        <select name="typeName" class="typeName">
<!--          <option>请选择</option>-->
<!--          <option>笔记本</option>-->
<!--          <option>电视机</option>-->
        </select>
      </li>
      <li> 商品型号:
        <input name="productModel" type="text" />
      </li>
      <li> 状态：
        <select name="productStatus" class="productStatus">
          <option value="2">请选择</option>
          <option value="1">可用</option>
          <option value="0">不可用</option>
        </select>
      </li>
      <li class="subBut productBtn"><img src="../../images/t06.png" />查询</li>
      <li class="subBut" onclick="window.location.href='/purchase/product/productAdd.html'"><img src="../../images/t01.png" />添加</li>
    </ul>
    <table class="tablelist">
      <thead>
        <tr>
          <th>序号</th>
          <th>品牌名称</th>
          <th>商品类型</th>
          <th>商品型号</th>
          <th>单位</th>
          <th>状态</th>
          <th>创建时间</th>
          <th>创建人</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <tr th:each="product,uStat : ${productList.data}">
          <td th:text="${uStat.count}"></td>
          <td class="brandname2">[[${product.brandName}]]</td>
          <td class="typeName2">[[${product.typeName}]]</td>
          <td class="productModel">[[${product.productModel}]]</td>
          <td class="productUnit">[[${product.productUnit}]]</td>
          <td th:text="${product.productStatus=='1'?'可用':'不可用'}"></td>
          <td th:text="${#dates.format(product.createTime,'yyyy-MM-dd HH:mm:ss')}"></td>
          <td>[[${product.createName}]]</td>
          <td>
            <a th:href="@{'/productManage/toUpdateProductView/'+${product.typeName}+'/'+${product.productModel}}" class="tablelink">修改</a>
            <a href="javascript:void(0)" class="tablelink" onclick="deleteProduct()">注销</a>
          </td>
        </tr>
      </tbody>
    </table>
    <div class="pagin">
      <div class="message">共<i class="blue">[[${productList.totalRows}]]</i>条记录，当前显示第&nbsp;<i class="blue">[[${productList.pageNum}]]&nbsp;</i>页</div>
      <ul class="paginList">
        <li class="paginItem" th:if="${productList.pageNum>1}"><a th:href="@{${'getProductByCondition'}(pageNum=${productList.pageNum-1})}"><span class="pagepre"></span></a></li>
        <li class="paginItem"><a th:href="@{${'getProductByCondition'}(pageNum=${1})}">1</a></li>
        <li class="paginItem current"><a th:href="@{${'getProductByCondition'}(pageNum=${2})}">2</a></li>
        <li class="paginItem more"><a href="javascript:;">...</a></li>
        <li class="paginItem"><a th:href="@{${'getProductByCondition'}(pageNum=${productList.totalPage})}">[[${productList.totalPage}]]</a></li>
        <li class="paginItem" th:if="${productList.pageNum<=productList.totalPage-1}"><a th:href="@{${'getProductByCondition'}(pageNum=${productList.pageNum+1})}"><span class="pagenxt"></span></a></li>
      </ul>
    </div>
  </form>
  <!-- 提示框 -->
  <div id="tip" class="tip">
    <div class="tiptop"><span>提示信息</span><a onclick="tipClose()"></a></div>
    <div class="tipinfo"> <span><img src="../../images/ticon.png" /></span>
      <div class="tipright">
        <p></p>
        <cite>如果是请点击确定按钮 ，否则请点取消。</cite> </div>
    </div>
    <div class="tipbtn">
      <input name="" type="button"  class="sure" value="确定" onclick="tipClose()" />
      &nbsp;
      <input name="" type="button"  class="cancel" value="取消" onclick="tipClose()" />
    </div>
  </div>
</div>
<script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');


    $(function (){

      // 给查询添加点击事件，提交表单
      $(".productBtn").click(function (){
        $("#productForm").submit();
      })


    })

</script>
</body>
</html>
